using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Formboard
{
    public partial class SideMenu : UserControl
    {

        public Image myAvatar;

        public SideMenu(String myname, EnumCell mycolor)
        {
           
            InitializeComponent();
            labelName.Text = myname;
            if (mycolor == EnumCell.White)
            {
                myAvatar = Properties.Resources.wstone;
            }
            else
            {
                myAvatar = Properties.Resources.bstone;
            }
            pictureBoxAvatar.BackColor = System.Drawing.Color.Transparent;
            pictureBoxAvatar.Image = myAvatar;
        }

        private void SideMenu_Load(object sender, EventArgs e)
        {
            
        }

        private void buttonLeaveGame_Click(object sender, EventArgs e)
        {
            ((Form1)this.Parent).threadupdate.Abort();
            ((Form1)this.Parent).goto_gameLaucher_from_board();   
        }

        private void SideMenu_Load_1(object sender, EventArgs e)
        {

        }

        private void buttonSkip_Click(object sender, EventArgs e)
        {
            ((Form1)this.Parent).gameBoard.myturn = false;
            ((Form1)this.Parent).gameBoard.lastSeqNumber++;
            ((Form1)this.Parent).gameBoard.TellGrandFatherToSendAMove(-1, -1);
            ((Form1)this.Parent).gameBoard.TellGrandFatherToUpdateHistory(((Form1)this.Parent).gameBoard.lastSeqNumber, ((Form1)this.Parent).gameBoard.myColor, -1, -1);
        }
    }
}
